package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.OrderDtl;
import com.xmtlxx.tms.domain.bo.OrderDtlBo;
import com.xmtlxx.tms.domain.vo.OrderDtlVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单明细Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface OrderDtlMapper extends BaseMapperPlus<OrderDtlMapper, OrderDtl, OrderDtlVo> {
    /**
     * 根据条件分页查询订单明细
     *
     * @param orderDtl 订单明细
     * @return Page OrderDtl
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "o.create_by"),
//        @DataColumn(key = "deptName", value = "o.dept_id"),
//        @DataColumn(key = "userName", value = "o.create_by")
//    })
    Page<OrderDtlVo> selectPageOrderDtlList(@Param("page") Page<OrderDtl> page,@Param("orderDtl") OrderDtlBo orderDtl);

    /**
     * 查询订单明细列表
     *
     * @param orderDtl 订单明细
     * @return 订单明细集合
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "o.create_by"),
//        @DataColumn(key = "deptName", value = "o.dept_id"),
//        @DataColumn(key = "userName", value = "o.create_by")
//    })
    List<OrderDtlVo> selectOrderDtlList(@Param("orderDtl") OrderDtlBo orderDtl);

    List<OrderDtlVo> selectOrderDtls(String orderId);

    OrderDtlVo selectOrderDtlVoByID(String id);

    Boolean deleteVoById(String id);

    List<OrderDtl> selectOrderDtlsByOrderId(@Param("orderDtl") OrderDtlBo orderDtl);

    int updateOrderDtl(@Param("orderDtl") OrderDtl orderDtl);

    int updateOrderDtlBatchById(@Param("list") List<OrderDtl> orderDtls);

    void removeOrderDtlBatch(@Param("list") List<OrderDtl> orderDtls);
}
